{% extends 'management/base.html' %}
{% load admin_helper %}

{% block subject %}用户列表{% endblock %}

{% block body %}
<table class="table table-hover">
    <thead>
        <tr>
            <th>昵称</th>
            <th>邮箱</th>
            <th>等级</th>
            <th>RANK</th>
            <th>动作</th>
        </tr>
    </thead>
    <tbody>
    {% for user in object_list %}
        <tr>
            <td><a href="{% url 'management-user-detail' pk=user.id %}">{{ user.nickname }}</a></td>
            <td>{{ user.email }}</td>
            <td>{{ user.get_level_display | whitehat_tag }}</td>
            <td>{{ user.rank }}</td>
            <td>
                <a href="{% url 'management-user-detail' pk=user.id %}" class="btn btn-primary btn-xs" role="button">详情</a>
                <a href="{% url 'management-user-coin' uid=user.id %}" class="btn btn-success btn-xs" role="button">奖惩</a>
                <a href="{% url 'management-user-coin-log' uid=user.id %}" class="btn btn-info btn-xs" role="button">金币日志</a>
                <a href="{{ user.get_absolute_url }}" target="_blank" class="btn btn-warning btn-xs">前台</a>
                {% if user.is_active %}
                <a href="javascript:submit('{% url 'management-user-ban' pk=user.id %}')" target="_blank" class="btn btn-danger btn-xs confirm-alert">禁用</a>
                {% else %}
                <a href="javascript:submit('{% url 'management-user-ban' pk=user.id %}')" target="_blank" class="btn btn-default btn-xs confirm-alert">启用</a>
                {% endif %}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
    {% include 'management/_pagination.html' %}
{% endblock %}